Namespace RSS
    Public Module mdRssDeclaraciones
        Public Structure strRssImagen
            Dim titulo As String
            Dim url As String 'url de la image
            Dim link As String 'link a la pagina donde debe apuntar la image
        End Structure

        Public Function GetRFC822Date(ByVal pDateTime As DateTime) As String

            ' Date format should be as such
            ' Wed, 21 Sep 2005 09:40:02 GMT

            Dim sb As New System.Text.StringBuilder

            'pDateTime = pDateTime.AddHours(-6) ' Change depending on where your time zone is
            sb.Append(GetShortDayName(pDateTime.DayOfWeek.ToString))
            sb.Append(", ")
            sb.Append(pDateTime.Day)
            sb.Append(" ")
            sb.Append(GetShortMonth(pDateTime.Month))
            sb.Append(" ")
            sb.Append(pDateTime.Year)
            sb.Append(" ")
            sb.Append(PadTime(pDateTime.Hour))
            sb.Append(":")
            sb.Append(PadTime(pDateTime.Minute))
            sb.Append(":")
            sb.Append(PadTime(pDateTime.Second))
            sb.Append(" -0600")
            Return sb.ToString
        End Function

        Private Function PadTime(ByVal pTime As Integer) As String
            If pTime < 10 Then
                Return "0" & pTime
            Else
                Return pTime
            End If

        End Function

        Private Function GetShortDayName(ByVal pLongDay As String) As String
            Select Case pLongDay
                Case "Monday"
                    Return "Mon"
                Case "Tuesday"
                    Return "Tue"
                Case "Wednesday"
                    Return "Wed"
                Case "Thursday"
                    Return "Thu"
                Case "Friday"
                    Return "Fri"
                Case "Saturday"
                    Return "Sat"
                Case "Sunday"
                    Return "Sun"
                Case Else
                    Return "Mon"
            End Select
        End Function


        Private Function GetShortMonth(ByVal pIntMonth As Integer) As String
            Select Case pIntMonth
                Case 1
                    Return "Jan"
                Case 2
                    Return "Feb"
                Case 3
                    Return "Mar"
                Case 4
                    Return "Apr"
                Case 5
                    Return "May"
                Case 6
                    Return "Jun"
                Case 7
                    Return "Jul"
                Case 8
                    Return "Aug"
                Case 9
                    Return "Sep"
                Case 10
                    Return "Oct"
                Case 11
                    Return "Nov"
                Case 12
                    Return "Dec"
                Case Else
                    Return "Jan"
            End Select
        End Function

        Public Function arrayListAListaChannels(ByVal arr As ArrayList) As Collections.Generic.List(Of iRssCanal)
            Dim c As iRssCanal
            Dim aux As New Collections.Generic.List(Of iRssCanal)
            For Each c In arr
                aux.Add(c)
            Next
            Return aux
        End Function
        Public Function arrayListAListaItems(ByVal arr As ArrayList) As Collections.Generic.List(Of iRssItem)
            Dim i As iRssItem
            Dim aux As New Collections.Generic.List(Of iRssItem)
            For Each i In arr
                aux.Add(i)
            Next
            Return aux
        End Function
    End Module
    Public Interface iRssItem
        Property titulo() As String
        Property link() As String
        Property descripcion() As String
        Property fechaPublicacion() As DateTime
    End Interface
    Public Interface iRssCanal
        Property titulo() As String
        Property link() As String
        Property descripcion() As String
        Property fechaPublicacion() As DateTime
        Function getItems() As Collections.Generic.List(Of iRssItem)
        Property imagen() As RSS.strRssImagen
        Property ttl() As Integer
    End Interface



    

End Namespace
